#include "cutility.h"
#include "cconstdefinition.h"

using namespace cooking;

CUtility::CUtility()
{
}


int CUtility::getRoleId(const QString roleNameMap[][2], int roleStart, QString roleName) {
    int i = 0;
    int roleId = -1;
    while (roleNameMap[i][0] != KNullString) {
        if (roleName == roleNameMap[i][0]) {
            roleId = i;
            break;
        }
        i++;
    }

    if (roleId != -1) {
        roleId += roleStart;
    }
    return roleId;
}
